1. Technical Field
The embodiments herein generally relate to video decoding, and, more particularly, to an adaptive technique for frame buffer video compression and memory allocation in a video decoder.
2. Description of the Related Art
Video is composed of successive images called frames and each frame is composed of n×m pixels. A pixel is the smallest single component of an image which holds the brightness and color information of the image frame at a particular coordinate. Video applications such as video telephony and digital TV involve low bandwidth data transmission. When video is streamed over a wireless network for such applications, due to the low bandwidth there is a possibility of the data transmission being error prone. To overcome such problems, digital video compression standards have been defined by ISO and ITU such as MPEG-1, MPEG-2, MPEG-4, MPEG-7, H.261, H.263 and H.264. These compression standards typically achieve desirable reductions in frame data by comparing adjacent frames and removing details which are unchanged between two frames.
In most compression algorithms some form of loss in the decoded picture is expected. One approach that reduces this loss is by quantizing the signal in the transform domain instead of the pixel domain. Examples of such transforms are the Discrete Cosine Transform (DCT) the wavelet transforms and the sub band analysis filters. In a transform based compression algorithm, the picture is converted into the transform domain and a quantization scheme is applied to the coefficients to reduce the amount of information. The transformation has the effect of concentrating the energy into a few coefficients and noise can be introduced into these coefficients without affecting the perceived visual quality of the reconstructed picture.
I-frame, or “Intra-coded” frame is a reference frame that uses a block of 8×8 pixels within the frame to code itself. P-frame, or “Predictive” frame uses previous I-type or P-type frames as a reference to code the difference. FIG. 1 illustrates a conventional video compression technique with an I-frame as a reference frame and subsequent P-frames referencing the I-frame and previous P-frames. Each frame of n×m pixels is divided into blocks of 8×8 pixels. An I-frame 102, which is a reference frame, is sent first. It is followed by a P1-Frame 104, a P2-Frame 106, and so on. The P-Frames such as P1-Frame 104 and P2-Frame 106 are referenced to the I-frame 102 as well as the previous sent P-frames as shown in FIG. 1. Each 8×8 pixels block of a P-Frame is compared to the blocks of the I-Frame 102, so that every block of a P-Frame can be expressed as a simple displacement and rotation of pixels. The referencing of P-frames to the I-frame 102 as well previously sent P-frames is done up to N frames. In the H.264 standard, the number of frames N is 16.
These frames are stored in a frame buffer as part of the memory. In the conventional video compression technique of FIG. 1, substantial memory is required to be allocated for storing the N compressed frames. Most of the time, only one reference frame is used but still the rest of the N−1 Frames consume memory. Moreover, when a certain frame is being decoded, the frame that will refer to it in the future is not known. Since memory is limited, there is a need for an improved technique for frame buffer video compression that can reduce memory allocated for frame buffers significantly.